<?php

class Post {

	//Sql object that handles all SQL calls
	private $Sql = false;
	
	//Bool to check if object constructed and initialized okay.
	public $Initialized = false;
	
	//Unique random identifier for post
	public $GUID = false;
	
	//The user who wrote the post..
	public $CreatorGUID = false;
	public $CreatorName = false;
	
	//The user who owns the pad
	public $OwnerGUID = false;
	public $OwnerName = false;
	
	public $Post = false;
	public $IsPrivate = false;
	public $CreationDate = false;
	
	public function __construct($data) {
		//$this->GUID = $data['GUID'];
		//$this->CreatorGUID = $data['CreatorGUID'];
		$this->CreatorName = $data['CreatorName'];
		//$this->OwnerGUID = $data['OwnerGUID'];
		//$this->OwnerName = $data['OwnerName'];
		$this->Post = $data['Post'];
		//$this->IsPrivate = $data['IsPrivate'];
		$this->CreationDate = $data['CreationDate'];
		$this->Initialized = true;
	}
	
	protected function GetPostByGUID($GUID) {
		$data = array();
		return new Post($data);
	}
	
	public function Render() {
		$postHTML = '';
		$postHTML .= '<h1>'.$this->CreatorName.'</h1>';
		$postHTML .= '<div class="PadPost">'.$this->Post.'</div>';
		$postHTML .= '<h2>'.$this->CreationDate.'</h2>';
		return $postHTML;
	}
}
?>